<?php

namespace App\Admin\Actions\Grid\Row\SwtMachine;

use App\Admin\Forms\MachineInstructForm as MachineInstructForm;
use Dcat\Admin\Grid\RowAction;
use Dcat\Admin\Widgets\Modal;

class MachineInstruct extends RowAction
{
    /**
     * @return string
     */
	protected $title = '指令';

    public function render()
    {
        // 实例化表单类并传递自定义参数
        $form = MachineInstructForm::make()->payload(['id' => $this->getKey()]);

        $button = <<<HTML
            <a><i class="feather icon-cloud text-info"></i> <span class="text-info">{$this->title}</span> &emsp;</a>
        HTML;

        return Modal::make()
            ->lg()
            ->title($this->title)
            ->body($form)
            ->button($button);
    }
}
